package com.jhclothing.common.enums;

import com.jhclothing.common.utils.StringUtils;

/**
 * 服饰尺码
 */
public enum ClothingSize {

    S("0", "S码"),
    M("1", "M码"),
    L("2", "L码"),
    XL("3", "XL码"),
    XXL("4", "XXL码"),
    XXXL("5", "XXXL码"),
    XXXXL("6", "XXXXL码");

    private String code;
    private String name;

    ClothingSize(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getClothingSizeNameByCode(String code) {
        if (StringUtils.isEmpty(code)) {
            return "";
        }
        for (ClothingSize clothingSize : ClothingSize.values()) {
            if (clothingSize.code.equals(code)) {
                return clothingSize.name;
            }
        }
        return "";
    }
}
